<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">


    <title>北京循一堂健康管理有限公司</title>

    <link href="./css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="./plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" type="text/css">
    <link href="./plugins/bootstrap-datepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="./css/page.css" />
    <link rel="stylesheet" href="./css/xxxx.css">
</head>


<body class="fixed-left">
    <script src="./js/jquery.min.js"></script>
    <script src="./js/include.js"></script>
    <script type="text/javascript">
        $(function () {
            $(".tab").slide({ //切换新闻
                titCell: ".hd li",
                mainCell: ".bd",
                targetCell: ".more li",
                effect: "fade",
                autoPlay: false,
                trigger: "click",
                easing: "linear",
                delayTime: 0
            });

            $(".yylb .tab").slide({ //切换新闻
                titCell: ".hd li",
                mainCell: ".bd",
                targetCell: ".more li",
                effect: "fade",
                autoPlay: false,
                trigger: "click",
                easing: "linear",
                delayTime: 0
            });

        });


    </script>
    <include src="common_header.html"></include> 
    <div class="main clearfix">
        <div class="tab fl">

            <div class="bd container">
                <ul class="yylb">
                    <div class="tab">
                        <div class="hd">
                            <ul>
                                <li style=" background: #9f7159;">
                                    <h1>本期预约（<span id="currentcount">0</span>人）</h1>
                                    <p id="currentdate"></p>
                                </li>
                                <li style="background: #b49f8d;">
                                    <h1>下期预约（<span id="nextcount">0</span>人）</h1>
                                    <p id="nextdate"></p>
                                </li>


                            </ul>
                        </div>

                        <div class="bd data-br clearfix">
                            <!--本期-->
                            <ul>
                                <div class="sw">
                                    <p>上午 9:00-11:00</p>
                                    <ul id="currentshang">

                                    </ul>
                                </div>

                                <div class="xw">
                                    <p>下午 13:40-15:00</p>
                                    <ul id="currentxia">
                                        

                                    </ul>
                                </div>

                                <div class="ws">
                                    <p>晚上 18:20-21:10</p>
                                    <ul id="currentwan">
   
                                    </ul>
                                </div>

                                <div class="add">
                                    <div class="img"></div>
                                    <button onclick="">添加</button>
                                </div>
                            </ul>

                            <!--下期-->
                            <ul>
                                <div class="sw">
                                    <p>上午 9:00-11:00</p>
                                    <ul id="nextshang">

                                    </ul>
                                </div>

                                <div class="xw">
                                    <p>下午 13:40-15:00</p>
                                    <ul id="nextxia">

                                    </ul>
                                </div>

                                <div class="ws">
                                    <p>晚上 18:20-21:10</p>
                                    <ul id="nextwan">
    

                                    </ul>
                                </div>

                                <div class="add">
                                    <div class="img"></div>
                                    <button onclick="">添加</button>
                                </div>
                            </ul>
                        </div>
                </ul>

            </div>
        </div>

    </div>
    <!-- 模态框（Modal）查看 -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        患者详情
                    </h4>
                </div>
                <div class="modal-body" style="padding: inherit">
                    <!-- <form class="form-horizontal" id="addPartyForm">
                        <div class="form-group">
                            <label for="org_orgName" class="col-sm-2 control-label">群组名称:</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="name" id="addgroupname" />
                            </div>
                        </div>

                    </form> -->
                    <div class="xxxx-box">
                        <!-- <div class="xxxx_head">
                            <ul>
                                <li class="xxxx_li1">患者信息</li>
                                <li class="xxxx_li2"><a href=""><img src="img/back.png"/></a></li>
                            </ul>
                        </div> -->
                        <div class="xxxx_center">
                            <div class="xxxx_left">
                                <ul>
                                    <li class="xxxx_left_li1"><img src="./images/touxiang.png"/></li>
                                    <!-- <li class="xxxx_left_li2">张某某</li>
                                    <li class="xxxx_left_li3">档案号：876108</li>
                                    <li class="xxxx_left_li3">性&nbsp&nbsp别：男</li>
                                    <li class="xxxx_left_li3">年&nbsp&nbsp龄：35岁</li> -->
                                </ul>
                            </div>
                            <div class="xxxx_right">
                                <div class="xxxx_right_first">
                                    <div class="xxxx_right_head">
                                        <ul>
                                            <li>基本信息</li>
                                        </ul>
                                    </div>
                                    <div class="xxxx_right_first_down">
                                        <ul>
                                            <li class="xxxx_right_first_down_li">姓&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp名：<span id="patientname">张毛毛</span></li>
                                            <li class="xxxx_right_first_down_li">姓&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp名：<span id="patientsex">女</span></li>
                                            <li class="xxxx_right_first_down_li">出生年月：<span id="patientbirthday">1974-01-01</span></li>
                                            <li class="xxxx_right_first_down_li">年&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp龄：<span id="patientage">30</span>岁</li>
                                            <li class="xxxx_right_first_down_li">手机号码：<span id="patientphone">138******</span></li>
                                            <li class="xxxx_right_first_down_li">身份证号：<span id="patientid">1310251563548562</span></li>
                                            <li class="xxxx_right_first_down_li">婚姻状况：<span id="patientmarray">已婚</span></li>
                                            <li class="xxxx_right_first_down_li">民&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp族：<span id="patientnation">汉</span></li>
                                            <li style="width: 100%;" class="xxxx_right_first_down_li">备&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp注：
                                                <div class="xxxx_right_first_down_border" id="patientremark">
                                                    
                                                </div>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                <div class="xxxx_right_second">
                                    <div class="xxxx_right_head">
                                        <ul>
                                            <li>病例信息</li>
                                        </ul>
                                    </div>
                                    <div class="xxxx_right_first_down">
                                        <ul>							
                                            <li style="width: 100%;"class="xxxx_right_first_down_li">过敏史：
                                                <div class="xxxx_right_first_down_border" id="patientguomin">
                                                    
                                                </div>
                                            </li>
                                            <li style="width: 100%;"class="xxxx_right_first_down_li">家族病史：
                                                <div class="xxxx_right_first_down_border" id="patientjiazu">
                                                    
                                                </div>
                                            </li>
                                            <li style="width: 100%;"class="xxxx_right_first_down_li">个人病史：
                                                <div class="xxxx_right_first_down_border" id="patientgeren">
                                                    
                                                </div>
                                            </li>
                                            <li style="width: 100%;"class="xxxx_right_first_down_li">个人病例：
                                                <div class="xxxx_right_first_down_border_new" id="patientcase">

                                                </div>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
            
                    </div>

                <!-- <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="button" class="btn btn-primary" id="userSaveBtn">
                        保存
                    </button> 
                </div>-->
            </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
    <br>
    <br>
    <br>
    <br>
    <div class="footer" style="left:0px">
        <p>版权所有 © 2018-2020 北京循一堂健康管理有限公司&nbsp;&nbsp;&nbsp;技术支持电话：010-62084321</p>
    </div>
    <script>
        var resizefunc = [];
    </script>

    <!-- jQuery  -->
    <script src="./js/bootstrap.min.js"></script>
    <script src="./plugins/select/js/bootstrap-select.min.js"></script>

    <script src="./plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="./plugins/bootstrap-table/bootstrap-table-zh-CN.min.js"></script>

    <script src="./plugins/bootstrap-datepicker/js/moment.js"></script>
    <script src="./plugins/bootstrap-datepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script src="./js/jquery.SuperSlide.2.1.1.js" type="text/javascript" charset="utf-8"></script>

    <script type="text/javascript">
        window.baseUrl = localStorage.getItem("baseUrl");
        window.moreSearch = "";
        window.sessionid=localStorage.getItem("sessionid");
        //console.log(localStorage.getItem("Authorization"));
        var doctorId=localStorage.getItem("doctorId");
        jQuery(document).ready(function ($) {

            $('#contentDiv').find('li').each(function () {
                $(this).click(function () {
                    console.log($(this).index());
                    var index = $(this).index();
                    if (index == 0) {
                        window.location.href = "patientlibrary.html";
                    } else if (index == 1) {
                        window.location.href = "appointlist.html";
                    } else if (index == 2) {
                        window.location.href = "workplan.html";
                        // }else if(index==3){
                        //     window.location.href="workplan.html";
                    } else if (index == 3) {
                        window.location.href = "usercenter.html";
                    } else if (index == 4) {
                        window.location.href = "medicalservice.html";
                    } else if (index == 5) {
                        window.location.href = "./im/main.html";
                    } else if (index == 7) {

                    } else if (index == 8) {

                    } else if (index == 9) {

                    }
                })
            });
            $.ajax({
                type: "POST",
                url: window.baseUrl + "/xunyitang/westAppoint/appointlist?jsessionid="+window.sessionid,
                contentType: "application/x-www-form-urlencoded",
                data: {
                    doctorId: doctorId
                },
                dataType: "json",
                async: false,
                beforeSend: function (request) {
                    request.setRequestHeader("Token", localStorage.getItem("Authorization"));
                },
                success: function (data) {
                    console.log("appointlist:"+data);
                    if (null != data && null != data.rows && data.rows.length>0) {
                        var object1= data.rows[0];
                        $("#currentcount").html(object1.count);
                        $("#currentdate").html(object1.datetime);
                        var type1=object1.type1;
                        if(null!=type1 && type1.length>0){
                            for (let i = 0; i < type1.length; i++) {
                                const element = type1[i];
                                $("#currentshang").append('<li><div class="tx-br"><img src="images/logo.jpg" height="74" /></div>'+
                                            '<div class="xx-br"><span>姓名：'+element.name+'</span><span>性别：'+element.sex+'</span><span>年龄：'+element.age+'</span><br />'+
                                                '<span>'+element.diagnose+'</span>'+
                                            '</div>'+
                                            '<div class="xq-br">'+
                                                '<button onclick="" class="b_ck fl" data-id="'+element.id+'" data-toggle="modal" data-target="#myModal"></button>'+
                                            '</div> </li>');
                            }
                        }
                        var type2=object1.type2;
                        if(null!=type2 && type2.length>0){
                            for (let i = 0; i < type2.length; i++) {
                                const element = type2[i];
                                $("#currentxia").append('<li><div class="tx-br"><img src="images/logo.jpg" height="74" /></div>'+
                                            '<div class="xx-br"><span>姓名：'+element.name+'</span><span>性别：'+element.sex+'</span><span>年龄：'+element.age+'</span><br />'+
                                                '<span>'+element.diagnose+'</span>'+
                                            '</div>'+
                                            '<div class="xq-br">'+
                                                '<button onclick="" class="b_ck fl" data-id="'+element.id+'" data-toggle="modal" data-target="#myModal"></button>'+
                                            '</div> </li>');
                            }
                        }
                        var type3=object1.type3;
                        if(null!=type3 && type3.length>0){
                            for (let i = 0; i < type3.length; i++) {
                                const element = type3[i];
                                $("#currentwan").append('<li><div class="tx-br"><img src="images/logo.jpg" height="74" /></div>'+
                                            '<div class="xx-br"><span>姓名：'+element.name+'</span><span>性别：'+element.sex+'</span><span>年龄：'+element.age+'</span><br />'+
                                                '<span>'+element.diagnose+' </span>'+
                                            '</div>'+
                                            '<div class="xq-br">'+
                                                '<button onclick="" class="b_ck fl" data-id="'+element.id+'" data-toggle="modal" data-target="#myModal"></button>'+
                                            '</div> </li>');
                            }
                        }

                        if(data.rows.length>1){
                            var object2=data.rows[1];
                            $("#nextcount").html(object2.count);
                            $("#nextdate").html(object2.datetime);
                            
                            var type1=object2.type1;
                            if(null!=type1 && type1.length>0){
                                for (let i = 0; i < type1.length; i++) {
                                    const element = type1[i];
                                    $("#nextshang").append('<li><div class="tx-br"><img src="images/logo.jpg" height="74" /></div>'+
                                                '<div class="xx-br"><span>姓名：'+element.name+'</span><span>性别：'+element.sex+'</span><span>年龄：'+element.age+'</span><br />'+
                                                    '<span>'+element.diagnose+'</span>'+
                                                '</div>'+
                                                '<div class="xq-br">'+
                                                    '<button onclick="" class="b_ck fl" data-id="'+element.id+'" data-toggle="modal" data-target="#myModal"></button>'+
                                                '</div> </li>');
                                }
                            }
                            var type2=object2.type2;
                            if(null!=type2 && type2.length>0){
                                for (let i = 0; i < type2.length; i++) {
                                    const element = type2[i];
                                    $("#nextxia").append('<li><div class="tx-br"><img src="images/logo.jpg" height="74" /></div>'+
                                                '<div class="xx-br"><span>姓名：'+element.name+'</span><span>性别：'+element.sex+'</span><span>年龄：'+element.age+'</span><br />'+
                                                    '<span>'+element.diagnose+'</span>'+
                                                '</div>'+
                                                '<div class="xq-br">'+
                                                    '<button onclick="" class="b_ck fl" data-id="'+element.id+'" data-toggle="modal" data-target="#myModal"></button>'+
                                                '</div> </li>');
                                }
                            }
                            var type3=object2.type3;
                            if(null!=type3 && type3.length>0){
                                for (let i = 0; i < type3.length; i++) {
                                    const element = type3[i];
                                    $("#nextwan").append('<li><div class="tx-br"><img src="images/logo.jpg" height="74" /></div>'+
                                                '<div class="xx-br"><span>姓名：'+element.name+'</span><span>性别：'+element.sex+'</span><span>年龄：'+element.age+'</span><br />'+
                                                    '<span>'+element.diagnose+' </span>'+
                                                '</div>'+
                                                '<div class="xq-br">'+
                                                    '<button onclick="" class="b_ck fl" data-id="'+element.id+'" data-toggle="modal" data-target="#myModal"></button>'+
                                                '</div> </li>');
                                }
                            }
                        }
                        $(".b_ck").click(function(){
                            var tempId = $(this).data().id;
                            $.ajax({
                                type: "POST",
                                url: window.baseUrl+"/patient/patient",
                                contentType: "application/x-www-form-urlencoded",
                                data:{patientId:tempId},
                                dataType: "json",
                                async:false,
                                beforeSend: function(request) {
                                    request.setRequestHeader("Token", localStorage.getItem("Authorization"));
                                },
                                success: function(data) {
                                    console.log(data.data);
                                    if(null!=data && null!=data.data){
                                        $("#patientname").html(data.data.name);
                                        $("#patientsex").html(data.data.sex);
                                        $("#patientbirthday").html(data.data.email);
                                        $("#patientage").html(data.data.age);
                                        $("#patientphone").html(data.data.phone);
                                        $("#patientid").html(data.data.idcard);
                                        $("#patientmarray").html(data.data.marriage);
                                        $("#patientnation").html(data.data.nation);
                                        $("#patientremark").html(data.data.remark);
                                        $("#patientguomin").html(data.data.allergic);
                                        $("#patientjiazu").html(data.data.familyhistory);
                                        $("#patientgeren").html(data.data.personalhistory);

                                    }
                                    
                                },
                                error: function(data) {

                                }
                            });
                            var doctorid= localStorage.getItem("doctorId");
                            $.ajax({
                                type: "POST",
                                url: window.baseUrl+"/case/caseList",
                                contentType: "application/x-www-form-urlencoded",
                                data:{patientId:tempId,doctorId:doctorid},
                                dataType: "json",
                                async:false, 
                                beforeSend: function(request) {                
                                    request.setRequestHeader("Token", localStorage.getItem("Authorization"));
                                },
                                success: function(data) {
                                    if(null!=data && null!=data.rows && data.rows.length>0){
                                        $("#patientcase").empty();
                                        for (let i = 0; i < data.rows.length; i++) {
                                            const element = data.rows[i];
                                            if(null!=element.createtime &&element.createtime.length>10){
                                                $("#patientcase").append('<ul><p class="xxxx_cleck">&nbsp&nbsp&nbsp&nbsp'+element.createtime.substring(0,10)+'初诊-就诊医生:胡凤亮</p>'+ 
                                                                '<li class="xxxx_right_first_down_border_li"><div class="xxxx_detial">'+
                                                                '<ul class="xxxx_detial_ul2"><li class="xxxx_detial_ul2_li1">主&nbsp&nbsp&nbsp&nbsp诉：</li><li class="xxxx_detial_ul2_li2">'+element.description+'</li></ul>'+
                                                                '<ul class="xxxx_detial_ul2"><li class="xxxx_detial_ul2_li1">检&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp查：</li><li class="xxxx_detial_ul2_li2">'+element.diagnose+'</li></ul>'+
                                                                '<ul class="xxxx_detial_ul2"><li class="xxxx_detial_ul2_li1">意&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp见：</li><li class="xxxx_detial_ul2_li2">'+element.advice+'</li></ul>'+
                                                                '</div></li></ul>');
                                            }
                                            $('.xxxx_cleck').click(function(){  
                                                if($(this).siblings("li").hasClass('on')){  
                                                    $(this).siblings("li").slideUp(500).removeClass("on");  
                                                }else{  
                                                    // 首先要清除其他li标签的on类名
                                                    $(this).parent().siblings().children("li").removeClass("on");
                                                    // on类名是随便起的，也可是active什么的都行
                                                    $(this).siblings("li").slideDown(500).addClass("on").parent().siblings().children("li").slideUp(500); 
                                                }  
                                            }); 
                                        }
                                    }

                                },
                                error: function(data) {
                                    window.location.href="index.html";
                                }
                            });
                        });

                    }
                },
                error: function (data) {
                    window.location.href="index.html";
                }
            });

        });
    </script>


</body>

</html>